<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用章申请总经理审批')" />
    <link rel="stylesheet" href="../../../../../../../../../../../../css/navigation.css">
</head>
<body class="gray-bg">
<div class="navigation visible-xs-block">
    <ol class="breadcrumb">
        <span> > </span>
        <li><a href="#" onclick="gomain()">主页</a></li>
        <li style="color: black">用章申请总经理审批</li>
    </ol>
    <div class="aLine"></div>
</div>
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>用章类型：</label>
<!--                            <select name="cType" th:with="type=${@dict.getType('')}">-->
<!--                                <option value="">所有</option>-->
<!--                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--                            </select>-->
                            <input type="text" name="cType"/>
                        </li>
                        <li>
                            <label>用途：</label>
                            <input type="text" name="cPurpose"/>
                        </li>
                        <li class="select-time">
                            <label>申请时间：</label>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCTime]"/>
                        </li>
                        <li>
                            <label>申请人：</label>
                            <input type="text" name="cPeople"/>
                        </li>
                        <li>
                            <label>审批状态：</label>
                            <select id="cStatus" name="cStatus" th:with="type=${@dict.getType('chapter_status')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
                            </select>
                        </li>
                        <li>
                            <label>审批意见：</label>
                            <input type="text" name="cOpinion"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

<!--        <div class="btn-group-sm" id="toolbar" role="group">-->
<!--            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="ruoyi:apply:add">-->
<!--                <i class="fa fa-plus"></i> 添加-->
<!--            </a>-->
<!--            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="ruoyi:apply:edit">-->
<!--                <i class="fa fa-edit"></i> 修改-->
<!--            </a>-->
<!--            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="ruoyi:apply:remove">-->
<!--                <i class="fa fa-remove"></i> 删除-->
<!--            </a>-->
<!--            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="ruoyi:apply:export">-->
<!--                <i class="fa fa-download"></i> 导出-->
<!--            </a>-->
<!--        </div>-->
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script src="../../../../../../../../../../../../js/breadcrumb.js"></script>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('ruoyi:apply:edit')}]];
    var removeFlag = [[${@permission.hasPermi('ruoyi:apply:remove')}]];
    var prefix = ctx + "ruoyi/applymanager";
    var cStatus = [[${@dict.getType('chapter_status')}]];
    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            showColumns: false,
            modalName: "用章申请总经理审批列表",
            columns: [{
                checkbox: true
            },
                {
                    field: 'cId',
                    title: '主键id',
                    visible: false
                },
                {
                    field: 'cPeople',
                    title: '申请人'
                },
                {
                    field: 'cType',
                    title: '用章类型'
                },
                {
                    field: 'cPurpose',
                    title: '用途'
                },
                {
                    field: 'cTime',
                    title: '申请时间'
                },
                {
                    field: 'cStatus',
                    align: "center",
                    title: '审批状态',formatter: function(value, row, index) {
                        return $.table.selectDictLabel(cStatus, value);
                    }
                },
                {
                    field: 'cOpinion',
                    title: '审批意见'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        if (row.cStatus ==1){
                            actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="consent(\'' + row.cId + '\')"><i class="fa fa-user"></i> 通过</a> ');
                            actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.cId + '\')"><i class="fa fa-edit"></i>驳回</a> ');
                        }
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
    function consent(cId) {

        $.modal.confirm("确认要通过申请吗?", function() {
            var url = prefix + "/consent";
            var data = { "cId": cId };
            $.operate.submit(url, "post", "json", data);
        });
    }
</script>
</body>
</html>